﻿IF NOT EXISTS(SELECT *
              FROM   sys.databases
              WHERE  name = 'LogDBName')
  BEGIN
      CREATE DATABASE LogDBName
  END
